Conversation
CLLTK_TRACEPOINT_FMT(buffer, "loaded {} in {}ms", name, ms) accepts
C++20 std::format placeholders. Validation happens at compile time
through a never-executed call to a helper taking std::format_string,
whose consteval constructor checks the literal against the argument
types - stronger than the printf attribute. Argument encoding is
unchanged (the library types arguments independently of format syntax);
the new meta entry type 5 only marks the syntax for decoders.
The varargs serializer is refactored around a va_list core so fmt
tracepoints get an entry point without the printf format attribute
({} strings must not be checked as printf formats). A char* argument
is always recorded as a string - {} has no printf %p/%s ambiguity.
C and kernel: not available (no compile-time {} validation exists
there); the macro fails with a static assert.
Signed-off-by: Jo5ta <jo5ta@mail.de>
Meta entry type 5 renders through the decoders' native {} formatters:
python str.format, C++ std::vformat. Arguments decode with the
existing type-array machinery including foreign-endian swapping; the
printf/ffi path is never touched for fmt entries. Formatting errors
degrade to the raw format string instead of failing the decode.
The C++ implementation wraps each decoded value in a small type with a
custom std::formatter that forwards the format spec, avoiding the
combinatorial std::visit-into-vformat instantiation blowup a naive
variant approach causes.
Signed-off-by: Jo5ta <jo5ta@mail.de>
Meta type mapping unit tests cover types 3-5. The integration test
compiles, runs, and decodes fmt tracepoints including format specs
({:x}, {:.2f}). Golden 1.6.0 fmt fixtures for aarch64 little endian
and s390x big endian validate both decoders against frozen files; the
generator gains a C++ writer that is skipped gracefully when
regenerating fixtures for versions without fmt support. The python
test harness target builds as C++20 (required by fmt tracepoints;
matches the examples). New example fmt_cpp shows usage including the
char*-as-string rule.
Signed-off-by: Jo5ta <jo5ta@mail.de>
README usage, file specification meta type 5, technical documentation of validation and rendering, AGENTS.md gotchas. New meta type is a file layout change: minor bump. Signed-off-by: Jo5ta <jo5ta@mail.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 6/7 — based on the export PR.
CLLTK_TRACEPOINT_FMT(buffer, "loaded {} in {}ms", name, ms)— std::format-style tracepoints for C++20, validated at compile time via a never-executedconstevalcheck againststd::format_string, so a malformed format or argument mismatch is a compile error. Runtime cost identical to printf tracepoints (same varargs core, refactored to a shared va_list path).__cpp_lib_format, kernel stub static-asserts with a clear message.str.format, C++ viastd::vformatwith a custom formatter wrapper over decoded arguments (avoids combinatorial visit instantiation).fmt_cpp, unit + integration tests, golden fixtures (LE and BE) with exact expected messages, docs.Version 1.6.0 (new meta entry type — layout addition).